
<?php /*
Hide and show tasks - Javascrip task.*/
?>
<html>
<head>
<script type="text/javascript">
function changetext(){
var selectbox= document.getElementById("selectbox").value;
var other1= document.getElementById("other");
var breakte = document.getElementById("breaktext");


if(selectbox == "1"){
var breakfast = 'Breakfast ready!!!';
}
if(selectbox == "2"){
var breakfast = 'Dinner ready!!!';
}
if(selectbox == "3"){
var breakfast = 'Lunch ready!!!';
}
if(selectbox == "4"){
other1.style.display='block';
breakte.style.display='none';
}
else{
other1.style.display='none';
breakte.style.display='block';
}

document.getElementById("breaktext").innerHTML = breakfast; 

}


</script>
</head>
<body>

<select type="option" onchange="changetext()" name="selectbox" value="select" id="selectbox">
<option value="1">Breakfast</option>
<option value="2">dinner</option>
<option value="3">lunch</option>
<option value="4">others</option>
</select>

<input type="text" name="other" value="" id="other" style="display:none;"/>

<div id="breaktext"></div>

</body>
<html>



